
package JET.physics.engine;

import JET.physics.bodies.SpringBody;
import JET.physics.interfaces.SceneTreeNode;
import java.util.ArrayList;

/**
 *
 * @author 057Ry
 */
public class SpringBodiesTreeNode implements SceneTreeNode {

    ArrayList<SpringBody> sbList;

    public SpringBodiesTreeNode(ArrayList<SpringBody> sbList) {
        this.sbList = sbList;
    }

    public void setSpringBodyList(ArrayList<SpringBody> sbList) {
        this.sbList = sbList;
    }
    public SceneTreeNode getChild(int index) {
        return (SceneTreeNode) sbList.get(index);
    }

    public int getChildCount() {
        return sbList.size();
    }

    public boolean isLeaf() {
        return sbList.isEmpty();
    }

    public int getIndexOfChild(Object child) {
        return sbList.indexOf(child);
    }
    public void resetNodeValue(Object o) {}

    public String toString() {
        return "Spring Bodies";
    }
}
